<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增表单推送信息')" />
    <th:block th:include="include :: select2-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-info-add">
            <div class="form-group">
                <label class="col-sm-3 control-label">开始时间：</label>
                <div class="col-sm-8">
                    <input name="startTime" id="startTime" class="form-control" autocomplete="off" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">结束时间：</label>
                <div class="col-sm-8">
                    <input name="endTime" id="endTime" class="form-control" autocomplete="off" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">间隔秒数：</label>
                <div class="col-sm-8">
                    <input name="intervalSecond" class="form-control" autocomplete="off" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label ">渠道类型：</label>
                <div class="col-sm-8">
                    <select name="formId" id="formId" class="form-control" >
                        <option  th:each="item:${channelInfoList}" th:text="${item.name}" th:value="${item.value}"></option>
                    </select>
                </div>
            </div>
<!--            <div class="form-group">-->
<!--                <label class="col-sm-3 control-label "></label>-->
<!--                <div class="col-sm-8">-->
<!--                    <button type="button" class=" btn btn-primary" onclick="submitHandler();">提交</button>-->
<!--                </div>-->
<!--            </div>-->
        </form>
    </div>
    <th:block th:include="include :: footer" />

    <th:block th:include="include :: select2-js" />
    <script th:inline="javascript">
        var prefix = ctx + "form/record"
        $("#form-info-add").validate({
            focusCleanup: true
        });

        function submitHandler() {
            console.log("asfdasdfasdf")
            if ($.validate.form()) {
                $.operate.save(prefix + "/pushDataSave", $('#form-info-add').serialize());
            }
        }

        layui.use('laydate', function(){
            var laydate = layui.laydate;

            laydate.render({
                elem: '#startTime',
                type: 'datetime'
            });

            laydate.render({
                elem: '#endTime',
                type: 'datetime'
            });

        });
    </script>
</body>
</html>